package com.css.fxfzaqbz.modules.data.service.impl;

import com.css.fxfzaqbz.modules.data.entity.IAAssistAnalyse;
import com.css.fxfzaqbz.modules.data.repository.IAAssistAnalyseRepository;
import com.css.fxfzaqbz.modules.data.service.IAAssistAnalyseService;
import com.css.fxfzaqbz.util.PlatformDateUtils;
import com.css.fxfzaqbz.util.UUIDGenerator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.sql.Timestamp;
import java.util.List;

@Service
public class IAAssistAnalyseServiceImpl implements IAAssistAnalyseService {

    @Autowired
    IAAssistAnalyseRepository iaAssistAnalyseRepository;

    @Override
    public IAAssistAnalyse saveIAAssistAnalyse(IAAssistAnalyse iaAssistAnalyse) {
        iaAssistAnalyse.setAaId(UUIDGenerator.getUUID());
        return iaAssistAnalyseRepository.saveIAAssistAnalyse(iaAssistAnalyse);
    }

    @Override
    public List<IAAssistAnalyse> getIAAssistAnalyseList(String id) {
        return iaAssistAnalyseRepository.getIAAssistAnalyseList(id);
    }

    @Override
    public IAAssistAnalyse getIAAssistAnalyseById(String id) {
        return iaAssistAnalyseRepository.getIAAssistAnalyseById(id);
    }

    @Override
    public void delIAAssistAnalyses(List<String> ids, String userID) {
        Timestamp timestamp = PlatformDateUtils.getCurrentTimestamp();
        iaAssistAnalyseRepository.delIAAssistAnalyses(ids, timestamp, userID);
    }

    @Override
    public IAAssistAnalyse updateIAAssistAnalys(IAAssistAnalyse iaAssistAnalyse) {
        iaAssistAnalyse.setUpdateTime(PlatformDateUtils.getCurrentTimestamp());
        return iaAssistAnalyseRepository.updateIAAssistAnalys(iaAssistAnalyse);
    }
}
